this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var r,a,l=t[0],s=t[1],i=t[2],b=0,p=[];b<l.length;b++)a=l[b],Object.prototype.hasOwnProperty.call(n,a)&&n[a]&&p.push(n[a][0]),n[a]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r]);for(u&&u(t);p.length;)p.shift()();return o.push.apply(o,i||[]),c()}function c(){for(var e,t=0;t<o.length;t++){for(var c=o[t],r=!0,l=1;l<c.length;l++){var s=c[l];0!==n[s]&&(r=!1)}r&&(o.splice(t--,1),e=a(a.s=c[0]))}return e}var r={},n={5:0,1:0},o=[];function a(t){if(r[t])return r[t].exports;var c=r[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,a),c.l=!0,c.exports}a.m=e,a.c=r,a.d=function(e,t,c){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(a.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(c,r,function(t){return e[t]}.bind(null,r));return c},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var l=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=l.push.bind(l);l.push=t,l=l.slice();for(var i=0;i<l.length;i++)t(l[i]);var u=s;return o.push([410,0]),c()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.htmlEntities},103:function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(0);function n(e,t){const c=Object(r.useRef)();return Object(r.useEffect)((()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)}),[e,t]),c.current}},11:function(e,t){e.exports=window.wp.compose},113:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e},114:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(0);const n=Object(r.createContext)({}),o=()=>{const{wrapper:e}=Object(r.useContext)(n);return t=>{e&&e.current&&(e.current.hidden=!t)}}},120:function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var r=c(8),n=c(6),o=c(0),a=c(47);const l=e=>{const{namespace:t,resourceName:c,resourceValues:l=[],query:s={},shouldSelect:i=!0}=e;if(!t||!c)throw new Error("The options object must have valid values for the namespace and the resource properties.");const u=Object(o.useRef)({results:[],isLoading:!0}),b=Object(a.a)(s),p=Object(a.a)(l),d=(()=>{const[,e]=Object(o.useState)();return Object(o.useCallback)((t=>{e((()=>{throw t}))}),[])})(),m=Object(n.useSelect)((e=>{if(!i)return null;const n=e(r.COLLECTIONS_STORE_KEY),o=[t,c,b,p],a=n.getCollectionError(...o);if(a){if(!(a instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");d(a)}return{results:n.getCollection(...o),isLoading:!n.hasFinishedResolution("getCollection",o)}}),[t,c,p,b,i]);return null!==m&&(u.current=m),u.current}},134:function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var r=c(0),n=c(1),o=c(7),a=c(6),l=c(2),s=c(5);const i=({clientId:e,setAttributes:t,filterType:c,attributes:i})=>{const{replaceBlock:u}=Object(a.useDispatch)("core/block-editor"),{heading:b,headingLevel:p}=i;if(Object(a.useSelect)((t=>{const{getBlockParentsByBlockName:c}=t("core/block-editor");return c(e,"woocommerce/filter-wrapper").length>0}),[e])||!c)return null;const d=[Object(r.createElement)(l.Button,{key:"convert",onClick:()=>{const r=[Object(o.createBlock)(`woocommerce/${c}`,{...i,heading:""})];b&&""!==b&&r.unshift(Object(o.createBlock)("core/heading",{content:b,level:null!=p?p:2})),u(e,Object(o.createBlock)("woocommerce/filter-wrapper",{heading:b,filterType:c},[...r])),t({heading:"",lock:{remove:!0}})},variant:"primary"},Object(n.__)("Upgrade block","woocommerce"))];return Object(r.createElement)(s.Warning,{actions:d},Object(n.__)("Filter block: We have improved this block to make styling easier. Upgrade it using the button below.","woocommerce"))}},135:function(e,t,c){"use strict";var r=c(0),n=c(5),o=c(11),a=c(1);c(186),t.a=Object(o.withInstanceId)((({className:e,headingLevel:t,onChange:c,heading:o,instanceId:l})=>{const s=`h${t}`;return Object(r.createElement)(s,{className:e},Object(r.createElement)("label",{className:"screen-reader-text",htmlFor:`block-title-${l}`},Object(a.__)("Block title","woocommerce")),Object(r.createElement)(n.PlainText,{id:`block-title-${l}`,className:"wc-block-editor-components-title",value:o,onChange:c,style:{backgroundColor:"transparent"}}))}))},136:function(e,t,c){"use strict";var r=c(0);c(187),t.a=({children:e})=>Object(r.createElement)("div",{className:"wc-block-filter-title-placeholder"},e)},142:function(e,t,c){"use strict";c.d(t,"b",(function(){return n})),c.d(t,"c",(function(){return o})),c.d(t,"a",(function(){return l}));var r=c(21);const n=e=>Object(r.c)(e,"count")&&Object(r.c)(e,"description")&&Object(r.c)(e,"id")&&Object(r.c)(e,"name")&&Object(r.c)(e,"parent")&&Object(r.c)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,o=e=>Array.isArray(e)&&e.every(n),a=e=>Object(r.c)(e,"attribute")&&Object(r.c)(e,"operator")&&Object(r.c)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every((e=>"string"==typeof e)),l=e=>Array.isArray(e)&&e.every(a)},15:function(e,t){e.exports=window.wp.url},157:function(e,t,c){"use strict";c.d(t,"a",(function(){return l})),c.d(t,"b",(function(){return s})),c.d(t,"c",(function(){return i})),c.d(t,"d",(function(){return u}));var r=c(3),n=c(142),o=c(6);const a=Object(r.getSetting)("attributes",[]).reduce(((e,t)=>{const c=(r=t)&&r.attribute_name?{id:parseInt(r.attribute_id,10),name:r.attribute_name,taxonomy:"pa_"+r.attribute_name,label:r.attribute_label}:null;var r;return c&&c.id&&e.push(c),e}),[]),l=e=>{const{count:t,id:c,name:r,parent:o}=e;return{count:t,id:c,name:r,parent:o,breadcrumbs:[],children:[],value:Object(n.b)(e)?e.attr_slug:""}},s=e=>{if(e)return a.find((t=>t.id===e))},i=e=>{if(e)return a.find((t=>t.taxonomy===e))},u=(e,t,c,r)=>{const n=Object(o.select)("core/block-editor"),a=Object(o.dispatch)("core/block-editor"),l=n.getBlockParents(e);let s="";l.forEach((e=>{const t=n.getBlock(e).innerBlocks.find((e=>e.name===r));t&&(s=t.clientId)})),a.updateBlockAttributes(s,{[t]:c})}},178:function(e){e.exports=JSON.parse('{"name":"woocommerce/active-filters","version":"1.0.0","title":"Active Filters Controls","description":"Display the currently active filters.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"multiple":false,"inserter":false,"color":{"text":true,"background":false},"lock":false},"attributes":{"displayStyle":{"type":"string","default":"list"},"headingLevel":{"type":"number","default":3}},"textdomain":"woocommerce","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},186:function(e,t){},187:function(e,t){},2:function(e,t){e.exports=window.wp.components},204:function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return o}));var r=c(105);const n=(e=[],t,c,n="")=>{const o=e.filter((e=>e.attribute===c.taxonomy)),a=o.length?o[0]:null;if(!(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(n)))return;const l=a.slug.filter((e=>e!==n)),s=e.filter((e=>e.attribute!==c.taxonomy));l.length>0&&(a.slug=l.sort(),s.push(a)),t(Object(r.a)(s).asc("attribute"))},o=(e=[],t,c,n=[],o="in")=>{if(!c||!c.taxonomy)return[];const a=e.filter((e=>e.attribute!==c.taxonomy));return 0===n.length?t(a):(a.push({attribute:c.taxonomy,operator:o,slug:n.map((({slug:e})=>e)).sort()}),t(Object(r.a)(a).asc("attribute"))),a}},21:function(e,t,c){"use strict";c.d(t,"b",(function(){return n})),c.d(t,"c",(function(){return o})),c.d(t,"a",(function(){return a}));var r=c(42);const n=e=>!Object(r.a)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return n(e)&&t in e}const a=e=>0===Object.keys(e).length},216:function(e,t){},22:function(e,t){e.exports=window.wc.priceFormat},25:function(e,t){e.exports=window.wp.isShallowEqual},259:function(e,t,c){"use strict";c.d(t,"b",(function(){return l})),c.d(t,"a",(function(){return s})),c.d(t,"d",(function(){return i})),c.d(t,"c",(function(){return u})),c.d(t,"e",(function(){return b}));var r=c(15),n=c(3),o=c(80);const a=Object(n.getSettingWithCoercion)("isRenderingPhpTemplate",!1,o.a),l="query_type_",s="filter_";function i(e){return window?Object(r.getQueryArg)(window.location.href,e):null}function u(e){a?((e=e.replace(/(?:query-(?:\d+-)?page=(\d+))|(?:page\/(\d+))/g,"")).endsWith("?")&&(e=e.slice(0,-1)),window.location.href=e):window.history.replaceState({},"",e)}const b=e=>{const t=Object(r.getQueryArgs)(e);return Object(r.addQueryArgs)(e,t)}},272:function(e,t,c){"use strict";var r=c(0),n=c(4),o=c.n(n),a=c(1),l=c(70),s=c(611);c(216);var i=({text:e,screenReaderText:t="",element:c="li",className:n="",radius:a="small",children:l=null,...s})=>{const i=c,u=o()(n,"wc-block-components-chip","wc-block-components-chip--radius-"+a),b=Boolean(t&&t!==e);return Object(r.createElement)(i,{className:u,...s},Object(r.createElement)("span",{"aria-hidden":b,className:"wc-block-components-chip__text"},e),b&&Object(r.createElement)("span",{className:"screen-reader-text"},t),l)};t.a=({ariaLabel:e="",className:t="",disabled:c=!1,onRemove:n=(()=>{}),removeOnAnyClick:u=!1,text:b,screenReaderText:p="",...d})=>{const m=u?"span":"button";if(!e){const t=p&&"string"==typeof p?p:b;e="string"!=typeof t?/* translators: Remove chip. */
Object(a.__)("Remove","woocommerce"):Object(a.sprintf)(/* translators: %s text of the chip to remove. */
Object(a.__)('Remove "%s"',"woocommerce"),t)}const f={"aria-label":e,disabled:c,onClick:n,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||n()}},O=u?f:{},g=u?{"aria-hidden":!0}:f;return Object(r.createElement)(i,{...d,...O,className:o()(t,"is-removable"),element:u?"button":d.element,screenReaderText:p,text:b},Object(r.createElement)(m,{className:"wc-block-components-chip__remove",...g},Object(r.createElement)(l.a,{className:"wc-block-components-chip__remove-icon",icon:s.a,size:16})))}},29:function(e,t,c){"use strict";var r=c(0),n=c(4),o=c.n(n);t.a=({label:e,screenReaderLabel:t,wrapperElement:c,wrapperProps:n={}})=>{let a;const l=null!=e,s=null!=t;return!l&&s?(a=c||"span",n={...n,className:o()(n.className,"screen-reader-text")},Object(r.createElement)(a,{...n},t)):(a=c||r.Fragment,l&&s&&e!==t?Object(r.createElement)(a,{...n},Object(r.createElement)("span",{"aria-hidden":"true"},e),Object(r.createElement)("span",{className:"screen-reader-text"},t)):Object(r.createElement)(a,{...n},e))}},3:function(e,t){e.exports=window.wc.wcSettings},410:function(e,t,c){e.exports=c(561)},411:function(e,t,c){"use strict";var r=c(0),n=c(9);const o=Object(r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(r.createElement)("path",{d:"M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"}));t.a=o},412:function(e,t){},413:function(e,t){},42:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>null===e},47:function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(0),n=c(25),o=c.n(n);function a(e){const t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},5:function(e,t){e.exports=window.wp.blockEditor},50:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(0);const n=Object(r.createContext)("page"),o=()=>Object(r.useContext)(n);n.Provider},561:function(e,t,c){"use strict";c.r(t);var r=c(0),n=c(7),o=c(411),a=c(70),l=c(4),s=c.n(l),i=c(5),u=c(1),b=c(135),p=c(2),d=c(62),m=c(3),f=c(29),O=c(80),g=c(21),j=c(142),y=c(259),w=c(136);c(413);var h=c(157),_=c(22),k=c(272),v=c(15),E=c(611),S=(c(113),c(178));const x=(e,t)=>Number.isFinite(e)&&Number.isFinite(t)?Object(u.sprintf)(/* translators: %1$s min price, %2$s max price */
Object(u.__)("Between %1$s and %2$s","woocommerce"),Object(_.formatPrice)(e),Object(_.formatPrice)(t)):Number.isFinite(e)?Object(u.sprintf)(/* translators: %s min price */
Object(u.__)("From %s","woocommerce"),Object(_.formatPrice)(e)):Object(u.sprintf)(/* translators: %s max price */
Object(u.__)("Up to %s","woocommerce"),Object(_.formatPrice)(t)),N=({type:e,name:t,prefix:c="",removeCallback:n=(()=>null),showLabel:o=!0,displayStyle:l})=>{const s=c?Object(r.createElement)(r.Fragment,null,c," ",t):t,i=Object(u.sprintf)(/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
Object(u.__)("Remove %s filter","woocommerce"),t);return Object(r.createElement)("li",{className:"wc-block-active-filters__list-item",key:e+":"+t},o&&Object(r.createElement)("span",{className:"wc-block-active-filters__list-item-type"},e+": "),"chips"===l?Object(r.createElement)(k.a,{element:"span",text:s,onRemove:n,radius:"large",ariaLabel:i}):Object(r.createElement)("span",{className:"wc-block-active-filters__list-item-name"},Object(r.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:n},Object(r.createElement)(a.a,{className:"wc-block-components-chip__remove-icon",icon:E.a,size:16}),Object(r.createElement)(f.a,{screenReaderLabel:i})),s))},C=(...e)=>{if(!window)return;const t=window.location.href,c=Object(v.getQueryArgs)(t),r=Object(v.removeQueryArgs)(t,...Object.keys(c));e.forEach((e=>{if("string"==typeof e)return delete c[e];if("object"==typeof e){const t=Object.keys(e)[0],r=c[t].toString().split(",");c[t]=r.filter((c=>c!==e[t])).join(",")}}));const n=Object.fromEntries(Object.entries(c).filter((([,e])=>e))),o=Object(v.addQueryArgs)(r,n);Object(y.c)(o)},A=["min_price","max_price","rating_filter","filter_","query_type_"],T=e=>{let t=!1;for(let c=0;A.length>c;c++){const r=A[c];if(r===e.substring(0,r.length)){t=!0;break}}return t};var R=c(120),L=c(10),B=c(204),P=({attributeObject:e,slugs:t=[],operator:c="in",displayStyle:n,isLoadingCallback:o})=>{const{results:a,isLoading:l}=Object(R.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[e.id]}),[s,i]=Object(d.b)("attributes",[]);if(Object(r.useEffect)((()=>{o(l)}),[l,o]),!Array.isArray(a)||!Object(j.c)(a)||!Object(j.a)(s))return null;const b=e.label,p=Object(m.getSettingWithCoercion)("isRenderingPhpTemplate",!1,O.a);return Object(r.createElement)("li",null,Object(r.createElement)("span",{className:"wc-block-active-filters__list-item-type"},b,":"),Object(r.createElement)("ul",null,t.map(((t,o)=>{const d=a.find((e=>e.slug===t));if(!d)return null;let m="";return o>0&&"and"===c&&(m=Object(r.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(u.__)("All","woocommerce"))),N({type:b,name:Object(L.decodeEntities)(d.name||t),prefix:m,isLoading:l,removeCallback:()=>{const c=s.find((({attribute:t})=>t===`pa_${e.name}`));1===(null==c?void 0:c.slug.length)?C(`query_type_${e.name}`,`filter_${e.name}`):C({[`filter_${e.name}`]:t}),p||Object(B.a)(s,i,e,t)},showLabel:!1,displayStyle:n})}))))},F=({displayStyle:e,isLoading:t})=>t?Object(r.createElement)(r.Fragment,null,[...Array("list"===e?2:3)].map(((t,c)=>Object(r.createElement)("li",{className:"list"===e?"show-loading-state-list":"show-loading-state-chips",key:c},Object(r.createElement)("span",{className:"show-loading-state__inner"}))))):null,Q=c(114),$=({attributes:e,isEditor:t=!1})=>{const c=Object(Q.a)(),n=function(){const e=Object(r.useRef)(!1);return Object(r.useEffect)((()=>(e.current=!0,()=>{e.current=!1})),[]),Object(r.useCallback)((()=>e.current),[])}()(),o=Object(m.getSettingWithCoercion)("isRenderingPhpTemplate",!1,O.a),[a,l]=Object(r.useState)(!0),i=(()=>{if(!window)return!1;const e=window.location.href,t=Object(v.getQueryArgs)(e),c=Object.keys(t);let r=!1;for(let e=0;c.length>e;e++){const t=c[e];if(T(t)){r=!0;break}}return r})()&&!t&&a,[b,p]=Object(d.b)("attributes",[]),[_,k]=Object(d.b)("stock_status",[]),[E,S]=Object(d.b)("min_price"),[A,R]=Object(d.b)("max_price"),[L,B]=Object(d.b)("rating"),$=Object(m.getSetting)("stockStatusOptions",[]),M=Object(m.getSetting)("attributes",[]),D=Object(r.useMemo)((()=>{if(i||0===_.length||(t=_,!Array.isArray(t)||!t.every((e=>["instock","outofstock","onbackorder"].includes(e))))||!(e=>Object(g.b)(e)&&Object.keys(e).every((e=>["instock","outofstock","onbackorder"].includes(e))))($))return null;var t;const c=Object(u.__)("Stock Status","woocommerce");return Object(r.createElement)("li",null,Object(r.createElement)("span",{className:"wc-block-active-filters__list-item-type"},c,":"),Object(r.createElement)("ul",null,_.map((t=>N({type:c,name:$[t],removeCallback:()=>{if(C({filter_stock_status:t}),!o){const e=_.filter((e=>e!==t));k(e)}},showLabel:!1,displayStyle:e.displayStyle})))))}),[i,$,_,k,e.displayStyle,o]),I=Object(r.useMemo)((()=>i||!Number.isFinite(E)&&!Number.isFinite(A)?null:N({type:Object(u.__)("Price","woocommerce"),name:x(E,A),removeCallback:()=>{C("max_price","min_price"),o||(S(void 0),R(void 0))},displayStyle:e.displayStyle})),[i,E,A,e.displayStyle,S,R,o]),W=Object(r.useMemo)((()=>!Object(j.a)(b)&&n||!b.length&&!(e=>{if(!window)return!1;const t=e.map((e=>`filter_${e.attribute_name}`)),c=window.location.href,r=Object(v.getQueryArgs)(c),n=Object.keys(r);let o=!1;for(let e=0;n.length>e;e++){const c=n[e];if(t.includes(c)){o=!0;break}}return o})(M)?(a&&l(!1),null):b.map((t=>{const c=Object(h.c)(t.attribute);return c?Object(r.createElement)(P,{attributeObject:c,displayStyle:e.displayStyle,slugs:t.slug,key:t.attribute,operator:t.operator,isLoadingCallback:l}):(a&&l(!1),null)}))),[b,n,M,a,e.displayStyle]);Object(r.useEffect)((()=>{var e;if(!o)return;if(L.length&&L.length>0)return;const t=null===(e=Object(y.d)("rating_filter"))||void 0===e?void 0:e.toString();t&&B(t.split(","))}),[o,L,B]);const V=Object(r.useMemo)((()=>{if(i||0===L.length||(t=L,!Array.isArray(t)||!t.every((e=>["1","2","3","4","5"].includes(e)))))return null;var t;const c=Object(u.__)("Rating","woocommerce");return Object(r.createElement)("li",null,Object(r.createElement)("span",{className:"wc-block-active-filters__list-item-type"},c,":"),Object(r.createElement)("ul",null,L.map((t=>N({type:c,name:Object(u.sprintf)(/* translators: %s is referring to the average rating value */
Object(u.__)("Rated %s out of 5","woocommerce"),t),removeCallback:()=>{if(C({rating_filter:t}),!o){const e=L.filter((e=>e!==t));B(e)}},showLabel:!1,displayStyle:e.displayStyle})))))}),[i,L,B,e.displayStyle,o]);if(!i&&!(b.length>0||_.length>0||L.length>0||Number.isFinite(E)||Number.isFinite(A))&&!t)return c(!1),null;const Y=`h${e.headingLevel}`,z=Object(r.createElement)(Y,{className:"wc-block-active-filters__title"},e.heading),K=i?Object(r.createElement)(w.a,null,z):z;if(!Object(m.getSettingWithCoercion)("hasFilterableProducts",!1,O.a))return c(!1),null;c(!0);const U=s()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===e.displayStyle,"wc-block-active-filters--loading":i});return Object(r.createElement)(r.Fragment,null,!t&&e.heading&&K,Object(r.createElement)("div",{className:"wc-block-active-filters"},Object(r.createElement)("ul",{className:U},t?Object(r.createElement)(r.Fragment,null,N({type:Object(u.__)("Size","woocommerce"),name:Object(u.__)("Small","woocommerce"),displayStyle:e.displayStyle}),N({type:Object(u.__)("Color","woocommerce"),name:Object(u.__)("Blue","woocommerce"),displayStyle:e.displayStyle})):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(F,{isLoading:i,displayStyle:e.displayStyle}),I,D,W,V)),i?Object(r.createElement)("span",{className:"wc-block-active-filters__clear-all-placeholder"}):Object(r.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{(()=>{if(!window)return;const e=window.location.href,t=Object(v.getQueryArgs)(e),c=Object(v.removeQueryArgs)(e,...Object.keys(t)),r=Object.fromEntries(Object.keys(t).filter((e=>!T(e))).map((e=>[e,t[e]]))),n=Object(v.addQueryArgs)(c,r);Object(y.c)(n)})(),o||(S(void 0),R(void 0),p([]),k([]),B([]))}},Object(r.createElement)(f.a,{label:Object(u.__)("Clear All","woocommerce"),screenReaderLabel:Object(u.__)("Clear All Filters","woocommerce")}))))},M=(c(412),c(134)),D=Object(p.withSpokenMessages)((({attributes:e,setAttributes:t,clientId:c})=>{const{className:n,displayStyle:o,heading:a,headingLevel:l}=e,s=Object(i.useBlockProps)({className:n});return Object(r.createElement)("div",{...s},Object(r.createElement)(i.InspectorControls,{key:"inspector"},Object(r.createElement)(p.PanelBody,{title:Object(u.__)("Display Settings","woocommerce")},Object(r.createElement)(p.__experimentalToggleGroupControl,{label:Object(u.__)("Display Style","woocommerce"),value:o,onChange:e=>t({displayStyle:e}),className:"wc-block-active-filter__style-toggle"},Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"list",label:Object(u.__)("List","woocommerce")}),Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"chips",label:Object(u.__)("Chips","woocommerce")})))),Object(r.createElement)(M.a,{attributes:e,clientId:c,setAttributes:t,filterType:"active-filters"}),a&&Object(r.createElement)(b.a,{className:"wc-block-active-filters__title",headingLevel:l,heading:a,onChange:e=>t({heading:e})}),Object(r.createElement)(p.Disabled,null,Object(r.createElement)($,{attributes:e,isEditor:!0})))}));const I={heading:{type:"string",default:Object(u.__)("Active filters","woocommerce")}};var W=[{attributes:{...S.attributes,...I},save:({attributes:e})=>{const{className:t,displayStyle:c,heading:n,headingLevel:o}=e,a={"data-display-style":c,"data-heading":n,"data-heading-level":o};return Object(r.createElement)("div",{...i.useBlockProps.save({className:s()("is-loading",t)}),...a},Object(r.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-filters__placeholder"}))}}];Object(n.registerBlockType)(S,{icon:{src:Object(r.createElement)(a.a,{icon:o.a,className:"wc-block-editor-components-block-icon"})},attributes:{...S.attributes,...I},edit:D,save({attributes:e}){const{className:t}=e;return Object(r.createElement)("div",{...i.useBlockProps.save({className:s()("is-loading",t)})},Object(r.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-filters__placeholder"}))},deprecated:W})},6:function(e,t){e.exports=window.wp.data},62:function(e,t,c){"use strict";c.d(t,"a",(function(){return b})),c.d(t,"b",(function(){return p})),c.d(t,"c",(function(){return d}));var r=c(8),n=c(6),o=c(0),a=c(25),l=c.n(a),s=c(47),i=c(103),u=c(50);const b=e=>{const t=Object(u.a)();e=e||t;const c=Object(n.useSelect)((t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)),[e]),{setValueForQueryContext:a}=Object(n.useDispatch)(r.QUERY_STATE_STORE_KEY);return[c,Object(o.useCallback)((t=>{a(e,t)}),[e,a])]},p=(e,t,c)=>{const a=Object(u.a)();c=c||a;const l=Object(n.useSelect)((n=>n(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(c,e,t)),[c,e]),{setQueryValue:s}=Object(n.useDispatch)(r.QUERY_STATE_STORE_KEY);return[l,Object(o.useCallback)((t=>{s(c,e,t)}),[c,e,s])]},d=(e,t)=>{const c=Object(u.a)();t=t||c;const[r,n]=b(t),a=Object(s.a)(r),p=Object(s.a)(e),d=Object(i.a)(p),m=Object(o.useRef)(!1);return Object(o.useEffect)((()=>{l()(d,p)||(n(Object.assign({},a,p)),m.current=!0)}),[a,p,d,n]),m.current?[r,n]:[e,n]}},7:function(e,t){e.exports=window.wp.blocks},8:function(e,t){e.exports=window.wc.wcBlocksData},80:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>"boolean"==typeof e},9:function(e,t){e.exports=window.wp.primitives}});